Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix creation performance of form element menuparent, (slow down in menu item edit form, for item that belongs to large menu) #11628

Merged
merged 3 commits into from
Aug 25, 2016

Conversation

ggppdk
Copy link
Contributor

@ggppdk ggppdk commented Aug 16, 2016

Fix creation performance of form element menuparent

  • used in menu item edit form

Summary of Changes

Remove unused left join in getOptions for menuparent form element

No reason because for it being there because

  1. Join is left
  2. The results of the join are not used anywhere neither in select nor where and not in any other clause
  3. There is no PHP code that adds some usage of it under some condition

Testing Instructions

Visit menu item edit form and, check parent menuitem form field is as before

Documentation Changes Required

@ggppdk ggppdk changed the title Fix creation performance of form element menuparent Remove unused left join in getOptions for menuparent form element Fix creation performance of form element menuparent, removing unused left join in getOptions for menuparent form element Aug 16, 2016
@ggppdk ggppdk changed the title Fix creation performance of form element menuparent, removing unused left join in getOptions for menuparent form element Fix creation performance of form element menuparent, (used in menu item edit form) Aug 16, 2016
@ggppdk
Copy link
Contributor Author

ggppdk commented Aug 16, 2016

1 more optimization, replaced unneeded
group by with distinct

For reasoning behind the above,

  • and for when the above can be done without problems

please see my comment here for similar fix in :
#9516 (comment)

which was followed by @alikon making a similar PR, that was tested and merged, see here:
#9689

(and there maybe 1 or 2 more places that need similar changes)

@brianteeman
Copy link
Contributor

Needs to be checked on all databases

On 16 August 2016 at 12:05, Georgios Papadakis notifications@github.com
wrote:

1 more optimization, replaced unneeded
group by with distinct

For reasoning behind the above,

  • and for when the above can be done without problems

please see my comment here for similar fix in :
#9516 (comment)
#9516 (comment)

which was followed by @alikon https://github.com/alikon making a
similar PR here , that was merged:
#9689 #9689


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#11628 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8TOWzIewyv1IKoTNKMeoDiJfOOsIks5qgZlngaJpZM4JlNVu
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@jeckodevelopment
Copy link
Member

Needs to be checked on all databases

@alikon can you help with this, please?

@ggppdk ggppdk changed the title Fix creation performance of form element menuparent, (used in menu item edit form) Fix creation performance of form element menuparent, (slow down in menu item edit form, for item that belongs to large menu) Aug 17, 2016
@prathumwan
Copy link

could not measure it with debug because running out of memory, but if you see the result done by hand it's a big improvement.

select order by result:
joomla patch 11628 before

select distinct result:
joomla patch 11628 after

@alikon
Copy link
Contributor

alikon commented Aug 17, 2016

in postgresql don't work as it is now , it give an SQL ERROR
for the ORDER BY clause field is used a.lft and therefore must be in the select list of fields when the SELECT use DISTINCT()

@ggppdk i've submitted a PR ggppdk#2 to your branch with the fix for postgresql

@jeckodevelopment always happy to help when free time permits ;)

in postgresql don't work as it is now , it give an **SQL ERROR**
 for the `ORDER BY` clause field used `a.lft` must be in the select list of fields when the `SELECT` use `DISTINCT()`
@ggppdk
Copy link
Contributor Author

ggppdk commented Aug 17, 2016

@alikon
Merged, thanks

@alikon
Copy link
Contributor

alikon commented Aug 17, 2016

@ggppdk thanks,
for the perfomance, have someone, some "decent" menu table dump to meter ?

p.s.
this query is still ugly a.published != -2 for example. etc...

@jeckodevelopment
Copy link
Member

@alikon you're our DB expert :) thank you

@ggppdk
Copy link
Contributor Author

ggppdk commented Aug 17, 2016

this query is still ugly a.published != -2 for example. etc...

ok but nothing significant to further improve performance

these 2 changes are enough to fix the performance issue, on large menu (with a few thousands of menu items)

  • removal of unsed self-join with the full table (unlike to the "parent" join that limits to -specific- row id)
  • the replacement of group-by with distinct , since we do not do use any aggregating function to calculate something

@alikon
Copy link
Contributor

alikon commented Aug 18, 2016

I have tested this item ✅ successfully on 2972851


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11628.

1 similar comment
@prathumwan
Copy link

I have tested this item ✅ successfully on 2972851


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11628.

@andrepereiradasilva
Copy link
Contributor

can we have RTC here?

@brianteeman
Copy link
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11628.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 21, 2016
@rdeutz rdeutz added this to the Joomla 3.6.3 milestone Aug 25, 2016
@rdeutz rdeutz merged commit 99a76db into joomla:staging Aug 25, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 25, 2016
@ggppdk ggppdk deleted the patch-24 branch August 25, 2016 21:26
roland-d pushed a commit to roland-d/joomla-cms that referenced this pull request Sep 11, 2016
…nu item edit form, for item that belongs to large menu) (joomla#11628)

* Remove unused left join in getOptions for menuparent form element

* Replaced unneeded group by with distinct

* fix joomla#11628 for postgresql (#2)

in postgresql don't work as it is now , it give an **SQL ERROR**
 for the `ORDER BY` clause field used `a.lft` must be in the select list of fields when the `SELECT` use `DISTINCT()`
roland-d added a commit to roland-d/joomla-cms that referenced this pull request Sep 11, 2016
…areable-draft-content

* origin/shareable-draft-content: (245 commits)
  Implement shareable draft links
  Cleaned up shared drafts view Added front-end token generarion
  Implement shared drafts view
  Remove obsolete file
  use only root (joomla#11703)
  com_search category results not displaying date (joomla#11802)
  warnings and errors, not notices ... (joomla#11801)
  [installation] Add javascript message titles and ajax errors strings (joomla#11800)
  Regression: Normalising head links and correcting hreflang for menu items associations (joomla#11769)
  Refactor allowEdit of backend category controller (joomla#11547)
  [com_contact] Move event trigger to correct place (joomla#11719)
  Improve the accessibility of the top menu in ISIS part 2 (joomla#11729)
  Show file extension (joomla#11776)
  change button -> a for the modal close button (joomla#11787)
  Small Grammar change (joomla#11788)
  Change message type to error when download of update package fails (joomla#11791)
  these are warnings not messages ... (joomla#11799)
  [plg_content_vote|pagebreak] Load language files only when needed (joomla#11730)
  [plg_system_stats] Load plugin language files only when needed (joomla#11728)
  Fix creation performance of form element menuparent, (slow down in menu item edit form, for item that belongs to large menu) (joomla#11628)
  ...

# Conflicts:
#	administrator/components/com_admin/script.php
#	administrator/components/com_content/models/shared.php
#	administrator/components/com_content/views/shared/tmpl/default.php
#	administrator/language/en-GB/en-GB.xml
#	administrator/language/en-GB/install.xml
#	administrator/manifests/files/joomla.xml
#	administrator/manifests/packages/pkg_en-GB.xml
#	installation/language/en-GB/en-GB.xml
#	language/en-GB/en-GB.xml
#	language/en-GB/install.xml
#	libraries/cms/pagination/pagination.php
#	libraries/cms/version/version.php
#	libraries/joomla/authentication/authentication.php
#	libraries/joomla/form/fields/color.php
#	libraries/joomla/form/fields/email.php
#	media/system/js/share-uncompressed.js
#	media/system/js/share.js
#	plugins/content/vote/vote.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants